#################################################
##### performing   ##############################
##### Statistical analysis of layers ############
##### in AFNI's PTA  ############################
#################################################

# for more information see this paper: 
# Chen, G., Nash, T.A., Cole, K.M., Kohn, P.D., Wei, S.-M., Gregory, M.D., Eisenberg, D.P., Cox, R.W., Berman, K.F., Shane Kippenhan, J., 2021. 
# Beyond linearity in neuroimaging: Capturing nonlinear relationships with application to longitudinal studies. 
# NeuroImage 233, 117891. https://doi.org/10.1016/j.neuroimage.2021.117891

PTA -prefix d1 -input d1.tbl \
    -model 's(layer)+s(layer,by=Condition)+s(run,bs="re")' \
    -vt run 's(run)' -Y Value                              \
    -prediction p1.tbl
 

#foplotting
#1dplot  -ok_1D_text 'd1-prediction.txt[4]{11..20}'  'd1-prediction.txt[4]{1..10}'


